package top.dark.design.patterns.singleton;

/**
 * Author: Darkn
 * description: 枚举类+holder，懒加载、高性能、唯一性
 * Create Time: 2021/4/25 16:41
 */
public class Singleton08 {

    private enum EnumHolder{
        SINGLETON08;
        private Singleton08 singleton;
        EnumHolder() {
            this.singleton = new Singleton08();
        }
        private Singleton08 getSingleton(){
            return singleton;
        }
    }

    public static Singleton08 getInstance() {
        return EnumHolder.SINGLETON08.getSingleton();
    }
}
